function Map(){
	var self = this;
	self.map1 = [
		[0,0,0,1,1,1,0,0],
		[0,0,0,1,4,1,0,0],
		[1,1,1,1,0,1,0,0],
		[1,4,3,0,3,1,1,1],
		[1,1,1,2,3,0,4,1],
		[0,0,1,3,1,1,1,1],
		[0,0,1,4,1,0,0,0],
		[0,0,1,1,1,0,0,0]
	];
	self.map2 = [
		[1,1,1,1,1,0,0,0,0],
		[1,0,0,0,1,1,0,0,0],
		[1,0,3,0,0,1,0,0,0],
		[1,1,0,3,0,1,1,1,1],
		[0,1,1,1,2,4,0,0,1],
		[0,0,1,0,0,4,1,0,1],
		[0,0,1,0,0,0,0,0,1],
		[0,0,1,1,1,1,1,1,1]
	];
	self.map3 = [
		[0,0,0,1,1,1,1,1,1,1],
		[0,0,1,1,0,0,1,0,2,1],
		[0,0,1,0,0,0,1,0,0,1],
		[0,0,1,3,0,3,0,3,0,1],
		[0,0,1,0,3,1,1,0,0,1],
		[1,1,1,0,3,0,1,0,1,1],
		[1,4,4,4,4,4,0,0,1,0],
		[1,1,1,1,1,1,1,1,1,0]
	];
	self.map4 = [
		[0,0,0,1,1,1,1,1,1,0],
		[0,1,1,1,0,0,0,0,1,0],
		[1,1,4,0,3,1,1,0,1,1],
		[1,4,4,3,0,3,0,0,2,1],
		[1,4,4,0,3,0,3,0,1,1],
		[1,1,1,1,1,1,0,0,1,0],
		[0,0,0,0,0,1,1,1,1,0]
	];
	self.map5 = [
		[0,1,1,1,1,1,1,0],
		[1,1,0,0,0,0,1,1],
		[1,0,3,0,3,3,0,1],
		[1,4,4,4,4,4,4,1],
		[1,0,3,3,0,3,0,1],
		[1,1,1,0,2,1,1,1],
		[0,0,1,1,1,1,0,0]
	];
	
	self.maps = [
		self.map1, self.map2, self.map3, self.map4, self.map5
	];
}
Map.prototype = {
	getMap: function(index){
		var self = this;
		var reMap = new Array();
		var temp;
		if(index == null){
			var index = Math.floor(Math.random() * self.maps.length);
			temp = self.maps[index];
		}else{
			if(index > self.maps.length)
				index = 1;
			temp = self.maps[index - 1];
		}
		
		var i;
		for(var i=0; i<temp.length; i++){
			reMap[i] = temp[i].concat();
		}
		return reMap;
	}
}
